<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>分词评测系统</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a href="<?php echo url('Home');?>" target="_self" class="Dig"><strong>HOME</strong></a>
<table width="5%" border="0" align="right">
  <tr>
    <td><a href="<?php echo url('Evaluation', 'Add');?>">添加实例</a></td>
  </tr>
</table>

<?
if ($pre != -1) {
print<<<eot
<table width="20%" border="0" align="center">
    <tr>
       <td width="50%" bgcolor="#DFDFDF"><h3>precision:</h3></td>
       <td bgcolor="#DFDFDF"><h3>{$pre}%</h3></td>
    </tr>
</table>
eot;
}
$postUrl = url('Evaluation', 'Index', array('page' => $PagerData['currentPage']));
print<<<eot
<br><br>
<!-- 注意这里pageID需要传送变量 -->
<!-- action后面指定这个表单将要提交的页面地址，设置为提交给自己 -->
<form id="form1" name="form1" method="post" action="{$postUrl}">
<table width="100%" border="0" align="center">
<tr>
<td width="30%" bgcolor="#DFDFDF">实例</td>
<!--<td width="15%" bgcolor="#DFDFDF">答案</td> -->
<td width="25%" bgcolor="#DFDFDF">结果</td>
<td width="3%" bgcolor="#DFDFDF">5分</td>
<td width="3%" bgcolor="#DFDFDF">4分</td>
<td width="3%" bgcolor="#DFDFDF">3分</td>
<td width="3%" bgcolor="#DFDFDF">2分</td>
<td width="3%" bgcolor="#DFDFDF">1分</td>
</tr>
eot;
		foreach ($rowset as $row)
		{
			$extra = "";
			$check = "checked=\"checked\"";
			$result = $row['result'];
			$is_force = true; //强制每次重新分析
			$src_data = urlencode($row['case']);
			$purl = $seg_server_url.$src_data;
			if (empty($row['result']) || $is_force) {
			    $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, $purl);
                curl_setopt($ch, CURLOPT_HEADER, 0);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                $result = curl_exec($ch);
                curl_close($ch);
			} else {
			    $result = $row['result'];
			}
print<<<eot
<tr>
<td height="24" bgcolor="#F3F3F3">
<label>
{$row['case']}
<!-- <input size="48" type="text" name="case{$row['id']}" value="{$row['case']}"/> -->
</label>
</td>
<!--<td height="24" bgcolor="#F3F3F3">
<label>
<input size="30" type="text" name="answer{$row['id']}" value="{$row['answer']}"/>
</label>
</td>-->
<td height="24" bgcolor="#F3F3F3">
<label>
{$result}
<!--<input size="95" type="text" name="result{$row['id']}" value="{$result}"/>-->
</label>
</td>
<td height="24" bgcolor="#F3F3F3"><input type="radio" name="score{$row['id']}" value="5" {$check} /></td>
<td height="24" bgcolor="#F3F3F3"><input type="radio" name="score{$row['id']}" value="4"/></td>
<td height="24" bgcolor="#F3F3F3"><input type="radio" name="score{$row['id']}" value="3"/></td>
<td height="24" bgcolor="#F3F3F3"><input type="radio" name="score{$row['id']}" value="2"/></td>
<td height="24" bgcolor="#F3F3F3"><input type="radio" name="score{$row['id']}" value="1"/></td>
</tr>
eot;
}

print<<<eot
</table>
<table width="60%" height="100" border="0" align="center">
<tr>
<td align="center"><input type="reset" name="Reset" value="重置" />
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="Submit2" value="计算" /></td>
</tr>
<tr><td>
<div align="center" class="Page_area">
eot;
?>
<a href=<?php echo url('Evaluation', 'index', array('page' => $PagerData['firstPage'])); ?> title='首页' class='Box_a'>&lt;&lt;</a>&nbsp;
<a href=<?php echo url('Evaluation', 'index', array('page' => $PagerData['prevPage'])); ?> title='上一页' class='Box_a'>&lt;</a>&nbsp;
<?php
	foreach($NavbarIndexs as $temp)
	{
		if($temp['index'] != $PagerData['currentPage'])
			echo "<a href='".url('Evaluation', 'index', array('page' => $temp['index']))."' title='' class='Box_a'>".$temp['number']."</a>&nbsp;";
		else
			echo "<span title='当前正在第".$temp['index']."页' class='Box_selected'>".$temp['number']."</span>&nbsp;";
	}
?>
<a href=<?php echo url('Evaluation', 'index', array('page' => $PagerData['nextPage'])); ?> title='下一页' class='Box_a'>&gt;</a>&nbsp;
<a href=<?php echo url('Evaluation', 'index', array('page' => $PagerData['lastPage'])); ?> title='末页' class='Box_a'>&gt;&gt;</a>&nbsp;
<?php
print<<<eot
</div>
</td></tr>
</table>
</form>
eot;
?>
</body>
</html>
